package com.huatai.exchange.impl;

import com.faneui.common.exception.BusinessException;
import com.huatai.exchange.dal.dao.ExcCustomerDAO;
import com.huatai.exchange.dal.model.ExcCustomer;
import com.huatai.exchange.service.ExcCustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ExcCustomerServiceImpl implements ExcCustomerService {

    @Autowired
    private ExcCustomerDAO excCustomerDAO ;

    @Override
    public List<ExcCustomer> queryExcCustomerList(ExcCustomer excCustomer) throws BusinessException {
        List<ExcCustomer>  customers = null;
        try{
            customers = excCustomerDAO.queryByModel(excCustomer) ;
        }catch (Exception ex) {
            BusinessException.throwBusinessException(ex);
        }
        return customers;
    }

    @Override
    public ExcCustomer queryExcCustomer(String id) throws BusinessException {
        ExcCustomer  customer = null;
        try{
            customer = excCustomerDAO.queryById(id) ;
        }catch (Exception ex) {
            BusinessException.throwBusinessException(ex);
        }
        return customer;
    }
}
